<?php
    header("content-type:text/html;charset=utf-8");
    $config = include_once('../../public/config/config.php');
    include_once('../../public/func/db.php');
    $table = 'reply';
    $_POST['ctime'] = time();
    $arr = select($config,'user');
    if(empty($_POST['aid'])){
        die("<script>alert('请选择博文标题！');window.location.href='updatereply.php?id=".$_POST['id']."'</script>");
    }else if(empty($_POST['reply'])){
        die("<script>alert('评论不能为空');window.location.href='updatereply.php?id=".$_POST['id']."'</script>");
    }else if(empty($_POST['uid'])){
        die("<script>alert('用户不能为空');window.location.href='updatereply.php?id=".$_POST['id']."'</script>");
    }
    $res = update($config,$table,$_POST);
    if(!empty($res)){
        echo "<script>alert('修改失败');window.location.href='updatereply.php?id=".$_POST['id']."'</script>";
    }else{
        echo "<script>alert('修改成功');window.location.href='reply.php'</script>";
    }
?>